﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class log : System.Web.UI.Page
{
    bestlifeDataContext db = new bestlifeDataContext();
    Tbl_User user = new Tbl_User();
    protected void Page_Load(object sender, EventArgs e)
    {
        
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        foreach (Tbl_User us in db.Tbl_Users)
        {

            if (us.Use_Name == TextBox1.Text && us.Pas_Word == TextBox2.Text)
            {
                Session["user"] = TextBox1.Text;
                Response.Redirect("logsucces.aspx");

            }
            else
            {
                Label1.Visible = true;
                Label1.Text = "Your user ID or Password is incorrect";
            }
        }
    }
}